<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Mosaddek">
    <meta name="keyword" content="FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <link rel="shortcut icon" href="newtemplatesfiles5/img/favicon.html">

    <title>编辑公告</title>

    <!-- Bootstrap core CSS -->
    <link href="newtemplatesfiles5/css/bootstrap.min.css" rel="stylesheet">
    <link href="newtemplatesfiles5/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="newtemplatesfiles5/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="newtemplatesfiles5/css/style.css" rel="stylesheet">
    <link href="newtemplatesfiles5/css/style-responsive.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
    <script src="newtemplatesfiles5/js/html5shiv.js"></script>
    <script src="newtemplatesfiles5/js/respond.min.js"></script>
    <![endif]-->
</head>

<body>

<section id="container" class="">
    <!--header start-->
    <div th:insert="common/schoolCounsellor-common-header::top"></div>
    <!--header end-->
    <!--sidebar start-->
    <div th:insert="common/schoolCounsellor-common-sidebar::#left"></div>
    <!--sidebar end-->
    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
            <!-- page start-->
            <div class="row">
                <!--schoolCounsellor-stuEibck-left  start-->
                <div th:insert="common/schoolCounsellor-publicize-left::#schoolCounsellor-publicize-left"></div>
                <!--schoolCounsellor-stuEibck-left  end-->
                <aside class="profile-info col-lg-9">
                    <!--widget start-->
                    <section class="panel">
                        <div class="twt-feed blue-bg">
                            <h1>编辑公告</h1>
                        </div>

                        <form id="myForm">
                            <div class="form-group">
                                <label>主题：</label>
                                <input name="title" type="text" class="form-control" placeholder="主题">
                            </div>
                            <div class="form-group">
                                <label>内容：</label>
                                <textarea id="textarea" name="text" placeholder="内容"></textarea>
                            </div>

                        </form>
                        <input type="submit" class="btn btn-lg btn-primary btn-block" value="发布" onclick="mySubmit()">
                    </section>
                    <!--widget end-->

                </aside>
            </div>
            <!-- page end-->
        </section>
    </section>
    <!--main content end-->

</section>
<script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="asserts/js/popper.min.js"></script>
<script src="asserts/js/feather.min.js"></script>
<script src="asserts/js/bootstrap.min.js"></script>

<!-- js placed at the end of the document so the pages load faster -->
<script src="newtemplatesfiles5/js/jquery.js"></script>
<script src="newtemplatesfiles5/js/bootstrap.min.js"></script>
<script src="newtemplatesfiles5/js/jquery.scrollTo.min.js"></script>
<script src="newtemplatesfiles5/js/jquery.nicescroll.js" type="text/javascript"></script>
<script src="newtemplatesfiles5/assets/jquery-knob/js/jquery.knob.js"></script>
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.js" referrerpolicy="origin"></script>

<script type="text/javascript">

    function mySubmit(){

        var form = new FormData(document.getElementById("myForm"));

        $.ajax({
            url:"uploadPublicize.do",
            type:"post",
            dataType:"html",
            data:form,
            cache:false,
            processData:false,
            contentType:false,
            success:function (data) {
                console.log(data);
                if(data=="success"){
                    alert("发布成功");
                    location.href="findAllMyPublicize.do";
                }else {
                    alert("发布失败 "+data);
                }
            },
            error:function (data) {
                console.log("error");
                alert("发布失败");
            }
        })

    };

    tinymce.init({
        selector: '#textarea',
        plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template code ' +
            'codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help ' +
            'emoticons autosave bdmap indent2em autoresize formatpainter axupimgs',
        toolbar: 'code undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link anchor\
             | alignleft aligncenter alignright alignjustify outdent indent | \
    styleselect formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
    table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | bdmap indent2em lineheight \
    formatpainter axupimgs',

        height: 2050, //编辑器高度

        min_height: 400,
        language:"zh_CN",
        images_upload_url: 'uploadPicture.do',
        setup: function(editor){
            editor.on('change',function(){ editor.save(); });
        },
    });
</script>
<!--common script for all pages-->
<script src="newtemplatesfiles5/js/common-scripts.js"></script>

<script>

    window.onload=function(){
        $("#li1").addClass('active');
        $("#li2").removeClass('active');
    };
    //knob
    $(".knob").knob();

</script>


</body>
</html>
